package tests.gui;

import javax.swing.*;
import java.awt.*;

public class JComboBox {
	public static void main(String[] args) {
		JFrame frame = new JFrame();
		JPanel panel = new JPanel(),
				panel1 = new JPanel(),
				panel2=new JPanel(), north=new JPanel();
		panel.add(new JLabel("JCheckBox Demo"));
		panel.add(new JCheckBox("1"));
		panel.add(new JCheckBox("2"));

		panel1.add(new JLabel("JComboBox Demo"));
		panel1.add(new javax.swing.JComboBox<>(new String[]{"a", "b"}));

		panel2.add(new JLabel("JList Demo"));
		panel2.add(new JList<>(new String[]{"c1","c2"}));
		ButtonGroup group=new ButtonGroup();
		JRadioButton[] buttons={
				new JRadioButton("A"),
				new JRadioButton("B"),
				new JRadioButton("C")
		};
		for (JRadioButton button:buttons){
			group.add(button);
			north.add(button);
		}
		frame.add(panel, BorderLayout.CENTER);
		frame.add(panel1, BorderLayout.EAST);
		frame.add(panel2,BorderLayout.SOUTH);
		frame.add(north,BorderLayout.NORTH);
		frame.setSize(0x200, 0x200);
		frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
		frame.setVisible(true);
	}
}
